package com.atdel.demo01;

/**
 * @BelongsProject: java_study
 * @BelongsPackage: com.atdel.demo
 * @Author: Del
 * @CreateTime: 2025-03-03  11:56
 * @Description: 测试类
 * @Version: 1.0
 */
public class MainTest {
    public static void main(String[] args) {
        // 创建两个乐器实例
        Instrument guitar = new Guitar("吉他");
        Instrument piano = new Piano("钢琴");

        // 创建音乐家实例
        Musician musician = new Musician();

        // 音乐家使用吉他演奏
        musician.perform(guitar);

        // 音乐家使用钢琴演奏
        musician.perform(piano);
    }
}